<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<div class="alert alert-info">收藏列表</div>
<table class="table table-bordered">
	<tr>
		<th>商品图片</th>
		<th>商品名称</th>
		<th>商品类别</th>
		<th>商品价格</th>
	</tr>
	<c:forEach items="${collections}" var="collection">
	   <tr>
	   		<td>
	   			<img src="${collection.getProduct().getImgurl()}" alt="${collection.getProduct().getName()}" style="width: 64px; height: 64px;" />
	   		</td>
	   		<td>${collection.getProduct().getName()}</td>
	   		<td>${collection.getProduct().getCategory()}</td>
	   		<td>${collection.getProduct().getPrice()}</td>
	   </tr>
	</c:forEach>
</table>
<nav>
  <ul class="pager">
  	<c:if test="${hasPrev}">
  		<li class="previous"><a href="${pageContext.request.contextPath}/FindUserCollectionServlet?id=${id}&page=${_page - 1}"><span aria-hidden="true">&larr;</span>上一页</a></li>
  	</c:if>
  	<c:if test="${hasNext}">
    	<li class="next"><a href="${pageContext.request.contextPath}/FindUserCollectionServlet?id=${id}&page=${_page + 1}">下一页 <span aria-hidden="true">&rarr;</span></a></li>
  	</c:if>
  </ul>
</nav>
<c:if test="${collections.size() == 0}">
	<div class="alert alert-danger" role="alert">该用户还没有收藏任何商品哦！</div>
</c:if>